import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int year = sc.nextInt();
        int month = sc.nextInt();
        int day = sc.nextInt();
        int[] arr = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
        int com = Arrays.stream(arr).sum();
        int leap = com + 1;
        int sum1 = 0;
        for (int i = 1; i < year; i++) {
            if (i % 400 == 0 || (i % 4 == 0 && i % 100 != 0))
                sum1 += leap;
            else
                sum1 += com;
        }
        System.out.println(sum1);
        int sum2 = sum1;
        for (int i = 1; i < month; i++) {
            if ((year % 400 == 0 || (year % 4 == 0 && year % 100 != 0))
                    && i == 2)
                arr[2] += 1;
            sum2 += arr[i];
        }
        System.out.println(sum2);
        System.out.println(sum2 + day);
    }
}
